const path = require('path');

const resolve = dir => path.join(__dirname, dir);
const serviceDomain = 'http://127.0.0.1:8060/';

module.exports = {
	baseUrl: '/',
	devServer: {
		proxy: {
			'/api': {
				target: `${serviceDomain}svnportal/`,
				ws: true,  // proxy websockets
				changeOrigin: true,
				pathRewrite: {
					'^/api': '',
				},
			},
		},
		port:3000,
	},
	configureWebpack: (config) => {
		config.optimization = {
			splitChunks: {
				minSize: 10000,
				maxSize: 256000,
			},
		};
		config.resolve = {
			extensions: ['.js', '.vue', '.json'],
			alias: {
				'@components': resolve('./src/components'),
				'@helper': resolve('./src/helper'),
				'@config': resolve('./src/config'),
				'@api': resolve('./src/api'),
				'@assets': resolve('./src/assets'),
			},
			plugins: [
			],
		};
	},
};
